home *** CD-ROM | disk | FTP | other *** search
- PROGRAM binary_output_example;
-
- TYPE dat_rec = RECORD
- count : INTEGER;
- size : REAL;
- name : STRING[30];
- END;
-
- VAR output_file : FILE of dat_rec;
- dog_food : ARRAY[1..20] OF dat_rec;
- index : BYTE;
-
- BEGIN (* main program *)
- ASSIGN(output_file,'KIBBLES.BIT');
- REWRITE(output_file);
-
- FOR index := 1 TO 20 DO
- BEGIN
- dog_food[index].count := index;
- dog_food[index].size := 12345.6789;
- dog_food[index].name := 'Large size Kibbles & Bits';
- END;
-
- WRITELN('Begin outputting data');
- FOR index := 1 TO 20 DO
- WRITE(output_file,dog_food[index]);
- CLOSE(output_file);
- WRITELN('End of output');
- END. (* of main program *)